//
//  EASaveUserMessage.m
//  WhatToEat
//
//  Created by Mac on 15/4/7.
//  Copyright (c) 2015年 Mac. All rights reserved.
//
#import "ConstansCode.h"
#import "AppDelegate.h"
#import "EASaveUserMessage.h"

@implementation EASaveUserMessage

+(void)saveUserMessage:(NSDictionary *)responseObject andView:(UIView *)v
{
    
    NSString *msg=[NSString stringWithFormat:@"%@",responseObject[@"code"]];
    
    if ([msg isEqualToString:@"1"]) {
        
        
        ApplicationDelegate.userId=responseObject[@"user"][@"id"];
        ApplicationDelegate.useName=responseObject[@"user"][@"username"];
        ApplicationDelegate.headImage=responseObject[@"user"][@"avatar"];
        
       ApplicationDelegate.userDictionary=responseObject[@"user"];
        
        ApplicationDelegate.tabooFoods=[responseObject[@"user"][@"taboo"] mutableCopy]?responseObject[@"user"][@"taboo"]:[@[] mutableCopy];

        
        
    }
    

}
@end
